package com.juntuo.service.helper;

import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.Mapper;

import java.util.Collection;
import java.util.List;

/**
 * 简介：
 * 作者：Jason (chenxj@hadlinks.com)
 * 时间：2018/3/21 15:57
 */
public class CommonServiceImpl<T> implements CommonService<T>{
    @Autowired
    private Mapper<T> mapper;

    @Override
    public T selectOne(T record) {
        return mapper.selectOne(record);
    }

    @Override
    public T selectByPrimaryKey(Object obj) {
        return mapper.selectByPrimaryKey(obj);
    }

    @Override
    public List<T> select(T record) {
        return mapper.select(record);
    }

    @Override
    public int selectCount(T record) {
        return mapper.selectCount(record);
    }



    @Override
    public List<T> selectByExample(Object example) {
        return mapper.selectByExample(example);
    }

    @Override
    public int insert(T record) {
        return mapper.insert(record);
    }

    @Override
    public int insertSelective(T record) {
        return mapper.insertSelective(record);
    }

    @Override
    public int delete(T record) {
        return mapper.delete(record);
    }

    @Override
    public int deleteByPrimaryKey(Object key) {
        return mapper.deleteByPrimaryKey(key);
    }




    @Override
    public int updateByPrimaryKey(T record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateByPrimaryKeySelective(T record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<T> selectAll() {
        return mapper.selectAll();
    }
}
